package com.tongguan.paypos.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.Gson;

/**
 * Created by Joylive on 2016/12/9 .
 */

public class TransInfo  implements Parcelable{
    /**
     * orderId : 920161209345241 订单号
     * upOrderId : 4005992001201612092290683291 上游订单号
     * channelId : WX 支付方式
     * costRate : null //成本汇率
     * agentId : 764798 //代理编号
     * agentRate : null //代理商汇率
     * ceiling : 0  //  0 封顶 1 不封顶 封顶汇率
     * bankAccount : null  //银行卡号
     * bank : null  //银行卡名称
     * payType : 1
     * settlement : 1
     * merchantId : 616072040100005
     * storeId : null
     * createTime : 2016-12-09 19:52:25
     * payTime : 2016-12-09 19:52:43
     * payMoney : 0.01
     * procedureFee : 0.01
     * settlementMoney : null
     * refundMoney : 0 //退款金额
     * state : 0
     * posId : N9NL10087289
     * cashier : 13912345678
     * merchantName : 威富通对私测试
     * storeName : 威富通对私测试
     * refundState : null 退款状态
     * batchNo : null 批次号
     * authorizeCode : null 授权码
     * couponMoney : 0 //优惠金额
     */

    private String orderId;
    private String upOrderId;
    private String channelId;
    private String costRate;
    private String agentId;
    private String agentRate;
    private String ceiling;
    private String bankAccount;
    private String bank;
    private String payType;
    private String settlement;
    private String merchantId;
    private String storeId;
    private String createTime;
    private String payTime;
    private double payMoney;
    private double procedureFee;
    private double settlementMoney;
    private double refundMoney;
    private String state;
    private String posId;
    private String cashier;
    private String merchantName;
    private String storeName;
    private String refundState;
    private String batchNo;
    private String authorizeCode;
    private double couponMoney;

    public TransInfo() {
    }

    protected TransInfo(Parcel in) {
        orderId = in.readString();
        upOrderId = in.readString();
        channelId = in.readString();
        costRate = in.readString();
        agentId = in.readString();
        agentRate = in.readString();
        ceiling = in.readString();
        bankAccount = in.readString();
        bank = in.readString();
        payType = in.readString();
        settlement = in.readString();
        merchantId = in.readString();
        storeId = in.readString();
        createTime = in.readString();
        payTime = in.readString();
        payMoney = in.readDouble();
        procedureFee = in.readDouble();
        settlementMoney = in.readDouble();
        refundMoney = in.readDouble();
        state = in.readString();
        posId = in.readString();
        cashier = in.readString();
        merchantName = in.readString();
        storeName = in.readString();
        refundState = in.readString();
        batchNo = in.readString();
        authorizeCode = in.readString();
        couponMoney = in.readDouble();
    }

    public static final Creator<TransInfo> CREATOR = new Creator<TransInfo>() {
        @Override
        public TransInfo createFromParcel(Parcel in) {
            return new TransInfo(in);
        }

        @Override
        public TransInfo[] newArray(int size) {
            return new TransInfo[size];
        }
    };

    public static TransInfo objectFromData(String str) {
        return new Gson().fromJson(str, TransInfo.class);
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getUpOrderId() {
        return upOrderId;
    }

    public void setUpOrderId(String upOrderId) {
        this.upOrderId = upOrderId;
    }

    public String getChannelId() {
        return channelId;
    }

    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }

    public String getCostRate() {
        return costRate;
    }

    public void setCostRate(String costRate) {
        this.costRate = costRate;
    }

    public String getAgentId() {
        return agentId;
    }

    public void setAgentId(String agentId) {
        this.agentId = agentId;
    }

    public String getAgentRate() {
        return agentRate;
    }

    public void setAgentRate(String agentRate) {
        this.agentRate = agentRate;
    }

    public String getCeiling() {
        return ceiling;
    }

    public void setCeiling(String ceiling) {
        this.ceiling = ceiling;
    }

    public String getBankAccount() {
        return bankAccount;
    }

    public void setBankAccount(String bankAccount) {
        this.bankAccount = bankAccount;
    }

    public String getBank() {
        return bank;
    }

    public void setBank(String bank) {
        this.bank = bank;
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType;
    }

    public String getSettlement() {
        return settlement;
    }

    public void setSettlement(String settlement) {
        this.settlement = settlement;
    }

    public String getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getPayTime() {
        return payTime;
    }

    public void setPayTime(String payTime) {
        this.payTime = payTime;
    }

    public double getPayMoney() {
        return payMoney;
    }

    public void setPayMoney(double payMoney) {
        this.payMoney = payMoney;
    }

    public double getProcedureFee() {
        return procedureFee;
    }

    public void setProcedureFee(double procedureFee) {
        this.procedureFee = procedureFee;
    }

    public double getSettlementMoney() {
        return settlementMoney;
    }

    public void setSettlementMoney(double settlementMoney) {
        this.settlementMoney = settlementMoney;
    }

    public double getRefundMoney() {
        return refundMoney;
    }

    public void setRefundMoney(double refundMoney) {
        this.refundMoney = refundMoney;
    }


    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getPosId() {
        return posId;
    }

    public void setPosId(String posId) {
        this.posId = posId;
    }

    public String getCashier() {
        return cashier;
    }

    public void setCashier(String cashier) {
        this.cashier = cashier;
    }

    public String getMerchantName() {
        return merchantName;
    }

    public void setMerchantName(String merchantName) {
        this.merchantName = merchantName;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public Object getRefundState() {
        return refundState;
    }

    public void setRefundState(String refundState) {
        this.refundState = refundState;
    }

    public String getBatchNo() {
        return batchNo;
    }

    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }

    public String getAuthorizeCode() {
        return authorizeCode;
    }

    public void setAuthorizeCode(String authorizeCode) {
        this.authorizeCode = authorizeCode;
    }

    public double getCouponMoney() {
        return couponMoney;
    }

    public void setCouponMoney(double couponMoney) {
        this.couponMoney = couponMoney;
    }

    @Override
    public String toString() {
        return "TransInfo{" +
                "orderId='" + orderId + '\'' +
                ", upOrderId='" + upOrderId + '\'' +
                ", channelId='" + channelId + '\'' +
                ", costRate='" + costRate + '\'' +
                ", agentId='" + agentId + '\'' +
                ", agentRate='" + agentRate + '\'' +
                ", ceiling='" + ceiling + '\'' +
                ", bankAccount='" + bankAccount + '\'' +
                ", bank='" + bank + '\'' +
                ", payType='" + payType + '\'' +
                ", settlement='" + settlement + '\'' +
                ", merchantId='" + merchantId + '\'' +
                ", storeId='" + storeId + '\'' +
                ", createTime='" + createTime + '\'' +
                ", payTime='" + payTime + '\'' +
                ", payMoney=" + payMoney +
                ", procedureFee=" + procedureFee +
                ", settlementMoney=" + settlementMoney +
                ", refundMoney=" + refundMoney +
                ", state='" + state + '\'' +
                ", posId='" + posId + '\'' +
                ", cashier='" + cashier + '\'' +
                ", merchantName='" + merchantName + '\'' +
                ", storeName='" + storeName + '\'' +
                ", refundState='" + refundState + '\'' +
                ", batchNo='" + batchNo + '\'' +
                ", authorizeCode='" + authorizeCode + '\'' +
                ", couponMoney=" + couponMoney +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(orderId);
        dest.writeString(upOrderId);
        dest.writeString(channelId);
        dest.writeString(costRate);
        dest.writeString(agentId);
        dest.writeString(agentRate);
        dest.writeString(ceiling);
        dest.writeString(bankAccount);
        dest.writeString(bank);
        dest.writeString(payType);
        dest.writeString(settlement);
        dest.writeString(merchantId);
        dest.writeString(storeId);
        dest.writeString(createTime);
        dest.writeString(payTime);
        dest.writeDouble(payMoney);
        dest.writeDouble(procedureFee);
        dest.writeDouble(settlementMoney);
        dest.writeDouble(refundMoney);
        dest.writeString(state);
        dest.writeString(posId);
        dest.writeString(cashier);
        dest.writeString(merchantName);
        dest.writeString(storeName);
        dest.writeString(refundState);
        dest.writeString(batchNo);
        dest.writeString(authorizeCode);
        dest.writeDouble(couponMoney);
    }
}
